package com.jbob.collection;

import java.util.ArrayList;

/**
 * Classe de collection de documents
 * @author lucas.bouabdelli jean-baptiste.guy
 */
public class DocumentXml 
{
	private String name;
	private ArrayList<Balise> balises;
	
	public DocumentXml()
	{
		balises = new ArrayList<>();
	}
	
	public String getName() 
	{
		return name;
	}
	public void setName(String name) 
	{
		this.name = name;
	}
	public ArrayList<Balise> getBalises() 
	{
		return balises;
	}
	public void setBalises(ArrayList<Balise> balises) 
	{
		this.balises = balises;
	}
	
	public void addBalise(Balise b)
	{
		balises.add(b);
	}
	
	@Override
	public String toString()
	{
		StringBuilder string = new StringBuilder();
		string.append(name);
		string.append(System.lineSeparator());
		for(Balise b : balises)
		{
			string.append(b.toString());
			string.append(System.lineSeparator());
		}
		return string.toString();
	}
}
